package dao.hrf;

import java.sql.ResultSet;
import java.sql.SQLException;

import dao.BaseDAO;
import dao.RowMapper;

public class CollectionDAO extends BaseDAO{
	public void addGoods(int member,int product){
		String sql1="select count(*) from tb_collection where member_id=? and product_id=?";
		int tag=get(sql1, new RowMapper<Integer>() {

			@Override
			public Integer mapper(ResultSet rs) throws SQLException {
				return rs.getInt(1);
			}
		}, member,product);
		if(tag == 0){
			String sql="insert tb_collection(Member_id,Product_id) values(?,?)";
			executeUpdate(sql, member,product);
		}
		
	}
}
